﻿
@{
    ViewBag.Title = "Home";
    Layout = "~/Views/Shared/_Layout.cshtml";
}
@using System.Configuration;
@using CSM_SQL;
@model List<ShowGoods>

<section class="all-product">
    <div class="container">
        <div class="row">
            @for (int i = 0; i <= 4; i++)
            {
                <div class="title">
                    <h2>
                        @{string title = "";

                            switch (i)
                            {

                                case 0:
                                    title = "零食&饮料";
                                    break;
                                case 1: title = "电子&数码"; break;
                                case 2: title = "厨卫&家居"; break;
                                case 3: title = "水果&干果"; break;
                                default: title = "其他"; break;
                            }
                        }
                        @title
                    </h2>
 
                </div>
                <!-- /title -->
                <!-- electonics -->
                <div class="electonics">


                    <div class="col-xs-12 col-sm-12 col-md-12">
                        <div class="row">
                            <!-- tab-content -->
                            <div class="tab-content">
                                <!-- tab-pane -->
                                    <div class="owl-demo-outer">
                                        <!-- #owl-demo -->
                                        <div id="owl-demo3" class="deals-wk2">
                                            <div class="item">

                                                <!-- e-product -->
                                                @foreach (var m in Model.Where(g => g.type == i))
                                                {
                                                    var path = ConfigurationManager.AppSettings["path"].ToString() + m.img;
                                                    <div class="bdr col-xs-12 col-sm-12 col-md-4">
                                                        <!-- e-product -->
                                                        <div class="e-product" style="height:400px">
                                                            <div class="pro-img" style="width:250px">
                                                                @if (m.grade >= 5)
    {
                                                            <sup class="sale-tag">sale!</sup>
}

                                                                <img src=@path alt="2" style="width:100%;height:200px;">
                                                                <div class="hover-icon">
                                                                    <a href="#"><i class="icon-heart icons" aria-hidden="true"></i>评分：@m.grade</a>
                                                                </div>
                                                            </div>
                                                            <div class="pro-text-outer" style="padding-left:10px;width:100%">
                                                                <h4>@m.name</h4>

                                                                <p style="overflow:auto"> @m.detail </p>

                                                                <p class="wk-price">￥@m.price </p>
                                                                <a href="javascript:void(0)" onclick="pick(@m.id)" class="add-btn">加入购物车</a>
                                                            </div>
                                                        </div>
                                                        <!-- /e-product -->
                                                    </div>
                                                }

                                            </div>

                                        </div>
                                    </div>


                            


                            </div>
                            <!-- /tab-content -->

                        </div>
                    </div>
                </div>
                <br />
                <hr />
                <br />
            }

        </div>
    </div>
</section>





